<!DOCTYPE HTML>
<html>
  <head>
    <meta name="viewport" content="width=320; user-scalable=no" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>ACT 2012</title>

	  <script type="text/javascript" charset="utf-8" src="script/cordova-1.8.0.js"></script>
	  <script type="text/javascript" charset="utf-8" src="script/jquery-1.7.2.js"></script>
	  <script type="text/javascript" charset="utf-8" src="script/mof-1.0.js"></script>
	  <!-- JS No propio -->
	  <script type="text/javascript" charset="utf-8" src="script/NoClickDelay.js"></script>
	  <!-- Plugins Propios -->
	  <script type="text/javascript" charset="utf-8" src="script/ACTDataAccess.js"></script>
	  <script type="text/javascript" charset="utf-8" src="script/ProgressDialog.js"></script>
	  <!-- Paquete idiomas -->
	  <script type="text/javascript" charset="utf-8" src="script/languages.js"></script>
	  <!-- primero el css default -->
	  <link href="css/mof.css" rel="stylesheet" >
	  
	  <!-- css os -->
	  <link href="os/android/css/native.css" rel="stylesheet" >
	  <script src="os/android/js/native.js" type="text/javascript" ></script>
	  
	  <!-- css theme -->
	  <link href="theme/default/css/theme.css" rel="stylesheet" >
	  
	  <script type="text/javascript" charset="utf-8">
      
	  	//var lan_es = new Array("Calendario","Equipos","Clasificación","Plantilla","Dirección","Resultados","Bandera","Lugar","Fecha","Hora","años en el club","Propio","No propio","Más","Idioma","Versión","Assunto","Mensaje","Enviar");
	  	var lan_ids = new Array("footer-1-egutegia","footer-2-taldeak","footer-3-sailkapena","","team-direction-title","regata-results-header","nombre-regata-label","toki-regata-label","data-regata-label","ordu-regata-label","","","","footer-4-gehiago","","","","","");
	  	
	  	var selectedLeague = "";
	  	var selLeagueKey = "selLeague";
	  	
	  	var selectedLanguage = "";
	  	var selLanguageKey = "selLan";
	  
	  	var smTaldeak = null;
	  	var etTaldeak = null;
	  	
	  	var smCalendario = null;
	  	var etCalendario = null;
	  	
	  	var smClasificacion = null;
	  	var etClasificacion = null;
	  	
	  	var iniTS;
	  	
	  	var onDeviceReady = function() {
        	document.addEventListener("menubutton", onMenuKeyDown, false);
            //document.getElementById("devready").innerHTML = "OnDeviceReady fired.";
            //alert("1 " + getSelectedLanguage());
            selectedLanguage = getSelectedLanguage();
            radioClick(document.getElementById("d_idioma_" + selectedLanguage));
            selectedLeague = getSelectedLeague();
            if(selectedLeague!=""){
            	openPage(document.getElementById('footer1'), 'page-egutegia');
            	getCalendario(); 
            }
            
            /*toggleClass('footer1', 'page', 'page-selected');
            toggleClass('page-egutegia', 'footer-section-clickable', 'footer-section-clickable-selected');*/
            
            //$("#banner-ini").removeClass("invisible").delay("2000").addClass("invisible");
        };

        function init() {
        	document.addEventListener("deviceready", onDeviceReady, true);
        	new NoClickDelay(document.getElementById("page-egutegia"));
        	new NoClickDelay(document.getElementById("page-taldeak"));
        }
              
        /*KeyEvent.prototype.menuTrigger = function(){
          var e = document.createEvent('Events');
          e.initEvent('menuKeyDown');
          document.dispatchEvent(e);
        }*/

        
        function activeLeague(idin, idout){
        	if(idin == "ls-sm"){
        		$("#" + idin).addClass("league-selection-box-selected-sm");
        		$("#" + idout).removeClass("league-selection-box-selected-et");
        	}else{
        		$("#" + idin).addClass("league-selection-box-selected-et");
        		$("#" + idout).removeClass("league-selection-box-selected-sm");
        	}
        	selectedLeague = idin;
        	saveSelectedLeague(idin);
        	var stage = $(".page-selected").attr('id');
        	//alert(stage);
        	switch(stage){
        		case "page-egutegia":
        		case "page-sailkapena":
        			openPage($("#footer1"), 'page-egutegia');
        			getCalendario();
        			break;
        		case "page-taldeak":
        		case "page-talde":
        		case "page-arraunlariak":
        			openPage($("#footer2"), 'page-taldeak');
        			getTeams();
        			break;
        		case "page-sailkapenak":
        			openPage($("#footer3"), "page-sailkapenak");
        			getClasificacion();
        			break;
        	}
        }
        
        function getSelectedLeague(){
        	var locSelLea = window.localStorage.getItem(selLeagueKey);
        	//alert(locSelLea);
        	if(locSelLea == null || locSelLea == "") return "";
        	if(locSelLea == "ls-sm")
        		$("#" + locSelLea).addClass("league-selection-box-selected-sm");
        	else
        		$("#" + locSelLea).addClass("league-selection-box-selected-et");
        	return locSelLea;
        }
        
        function saveSelectedLeague(id){
        	//alert(selLeagueKey + " -> " + id);
        	window.localStorage.setItem(selLeagueKey, id);        	
        }
        
        function radioClickIdioma(id){
        	//alert("OK!!!!->" + id + " " + document.getElementById(id).value);
        	fillValues(document.getElementById(id).value, lan_ids);
        	setTitle(getPositionValue(document.getElementById(id).value, 13));
        	//alert("OK!!!!2->" + id + " " + document.getElementById(id).value);
        	saveSelectedLanguage(document.getElementById(id).value);
        	//alert("OK!!!!3->" + id + " " + document.getElementById(id).value);
        }
        
        function getSelectedLanguage(){
        	//alert(window.localStorage.getItem(selLanguageKey));
        	if(window.localStorage.getItem(selLanguageKey)==null)
        		saveSelectedLanguage("es");
        	return window.localStorage.getItem(selLanguageKey);	
        }
        
        function saveSelectedLanguage(lan){
        	window.localStorage.setItem(selLanguageKey, lan);
        }
        
       function onMenuKeyDown(){
        	//alert("menu = " + $("footer").css("display"));
        	if($("footer").css("display")=="block"){
        		$("footer").css('display','none');
        		$("#backspacer").css('display','none');
        	}else{
        		$("footer").css('display','block');
        		$("#backspacer").css('display','block');
        	}
        }
        
        function getLeague(){
        	//alert(selectedLeague.substring(3));
        	if(selectedLeague == "")return "";
        	return selectedLeague.substring(3);
        }
        
        function getActiveLeagueTeamList(){
        	if(getLeague() == "sm")
        		return smTaldeak;
        	else
        		return etTaldeak;
        	
        }
        
        function selectLeagueFirst(){
        	if(getLeague==""){
        		navigator.notification.alert("Seleccione liga primero");
        	}
        }
        
        function getActiveLeagueCalendar(){
        	if(getLeague() == "sm"){
        		return smCalendario;
        	}else{
        		return etCalendario;
        	}
        }
           
        function getTeams(){
        	var liga = getLeague();
        	if(liga=="sm"){
        		if(smTaldeak!=null){
        			printTeamList(smTaldeak);
        			return;
        		}
        	}else if(liga=="sm"){
        		if(etTaldeak!=null){
        			printTeamList(etTaldeak);
        			return;
        		}
        	}        	
        	window.plugins.actDataAccess.getTeamData(
					function(result) {
						//alert(result.length + " " + result[0]);
						if(liga=="sm"){
							smTaldeak = result;
						}else{
							etTaldeak = result;
						}
						printTeamList(result);
						//alert("smTaldeak = " + smTaldeak);
		    		}, function(error) {

		    		}, [liga]
		    );
        }
        
        function printTeamList(result){
        	$("#list-taldeak").html("");
        	for(i =0; i< result.length; i++){
				$("#list-taldeak").append("<li id=\"" + result[i].idEquipo + "\" class=\"talde-box\"><a href=\"#\" class=\"team-link\" onclick=\"showTeam(" + i + ");\"><div class=\"ul-li-a-text\" >" + result[i].izena + "</div><div class=\"ui-icon ui-icon-arrow-right\"></div></a></li>");
			}
        }

        function showTeam(i){
        	//alert("showteam " + i);
        	var arrayLista = getActiveLeagueTeamList();
        	//alert(i + " " + arrayLista[i].idEquipo + " " + arrayLista[i].izena);
        	var taldea = arrayLista[i];
        	//alert(stringify(taldea));
        	setTitle(taldea.izena);
        	resetTeamData();
        	toggleClass("page-talde", 'page', 'page-selected');
        	//alert(taldea.logo);
        	if(taldea.logo == ""){
        		$("#team-logo").addClass("invisible");
        	}else{
        		$("#team-logo").removeClass("invisible");
        		$("#team-logo").html('<img src="img/taldeak/' + taldea.logo + '" />');	
        	}
        	if(taldea.helbidea1 == "" && taldea.helbidea2 == "" && taldea.helbidea3 == ""){
        		$("#team-direction-title").addClass("invisible");
        		$("#team-direction").addClass("invisible");
        	}else{
        		$("#team-direction-title").removeClass("invisible");
        		$("#team-direction").removeClass("invisible");
        		var helbidea = "";
        		if(taldea.helbidea1!="")
        			helbidea = taldea.helbidea1;
        		if(taldea.helbidea2!=""){
        			if(helbidea !="")
        				helbidea = helbidea + "<br/>";
        			helbidea = helbidea + taldea.helbidea2;
        		}
        		if(taldea.helbidea3!=""){
        			if(helbidea !="")
        				helbidea = helbidea + "<br/>";
        			helbidea = helbidea + taldea.helbidea3;
        		}
        		$("#team-direction").html(helbidea);
        	}
        	if(taldea.telefono == ""){
        		$("#team-telephone").addClass("invisible");
        		$("#team-telephone-title").addClass("invisible");
        	}else{
        		$("#team-telephone-title").removeClass("invisible");
        		$("#team-telephone").removeClass("invisible");
        	   	$("#team-telephone").text(taldea.telefono);
        	}
        	if(taldea.email == ""){
        		$("#team-mail").addClass("invisible");
        		$("#team-mail-title").addClass("invisible");
        	}else{
        		$("#team-mail-title").removeClass("invisible");
        		$("#team-mail").removeClass("invisible");
        	   	$("#team-mail").text(taldea.email);
        	}
        	if(taldea.web == ""){
        		$("#team-web").addClass("invisible");
        		$("#team-web-title").addClass("invisible");
        	}else{
        		$("#team-web-title").removeClass("invisible");
        		$("#team-web").removeClass("invisible");
        	   	$("#team-web").text(taldea.web);
        	}
        	$("#enlace-remeros").html('<a href="#" onClick="getRemeros(' + taldea.idEquipo + ')"><img src="img/imgPala.png" /></a>');
        }
        
        function resetTeamData(){
        	$("#team-direction").html("&nbsp;");
        	$("#team-telephone").text("&nbsp;");
        	$("#team-mail").text("&nbsp;");
        	$("#team-web").text("&nbsp;");
        }
        
        function getCalendario(){
        	var liga = getLeague();
        	var calendario = getActiveLeagueCalendar();
        	if (calendario != null){
        		printCalendar(calendario);
        		return;
        	}
        	window.plugins.actDataAccess.getCalendarioLiga(
					function(result) {
						//alert(result.length + " " + result[0]);
						if(liga=="sm"){
							smCalendario = result;
							//alert(smCalendario);
							//alert(getActiveLeagueCalendar());
						}else{
							etCalendario = result;
						}
						printCalendar(result);
					}, function(error) {
		    			
		    		}, [liga]	
		    );
        	
        }
                    
        function printCalendar(result){
        	$("#list-egutegia").html("");
        	for(i =0; i< result.length; i++){
        		$("#list-egutegia").append(
						"<li id=\"" + result[i].id + "\" class=\"talde-box\">" + 
						"<a href=\"#\" class=\"team-link\" onclick=\"getInfoAndResults(" + i + ", " + result[i].id + ")\">" +
							"<div class=\"ul-li-a-text\" >" +
								"<div class=\"single-line-text\">" + result[i].izena + "</div>" +
								"<div class=\"lugar info-adicional\">" + result[i].lekua + "</div>" +
								"<div class=\"fecha-hora info-adicional\">(" + result[i].data + " " + result[i].ordua + ")</div>" +
							"</div>" +
							"<div class=\"ui-icon ui-icon-arrow-right\"></div>" + 
						"</a>" +
					"</li>");
			}
        }
        
        function getRemeros(idTeam){
        	toggleClass("page-arraunlariak", 'page', 'page-selected');
        	$("#player-list").html("");
        	var liga = getLeague();
        	window.plugins.actDataAccess.getTeamMembers(
					function(result) {
						//alert(result.length + " " + result[0]);
						printPlayerList(result);
					}, function(error) {
		    			
		    		}, [liga, idTeam]	
		    );
        	
        }
        
        function printPlayerList(result){
        	$("#player-list").html("");
        	for(i =0; i< result.length; i++){
        		var procedencia = result[i].procedencia; 
        		if(procedencia == "Propio") procedencia = getPositionValue(selectedLanguage,11);
        		else if(procedencia == "No propio") procedencia = getPositionValue(selectedLanguage,12);
        		
        		$("#player-list").append(
        			'<li class="talde-box">' +
						'<div style="float:left;">' +
							'<img src="img/arraunlariak_l' + getLeague() + '/' + result[i].foto + '.jpg" />' +
						'</div>' +
						'<div class="ul-li-a-text width-70">' +
							result[i].nombre + ' ' + result[i].apellido +
							'<span class="sub-spacer">' + result[i].nacimiento + ' (' + result[i].lugar + ')</span>' +
							'<div class="info-adicional lugar font-normal">' + result[i].antiguedad + ' ' + getPositionValue(selectedLanguage,10) + '</div>' +
							'<div class="info-adicional fecha-hora">' + procedencia + '</div>' +
						'</div>' +
					'</li>');
        	}
        }
        
        function getClasificacion(){
        	$.ajax({
                type: "GET",
                url: "http://www.ligasanmiguel.com/xml/sailkapenaL" + getLeague().toUpperCase() + "2.php?d=2012",
                dataType: "xml",
                success: function(xml) {
                	$("#sailkapena-list").html("");
                   	//alert("OK -> " + xml);
                   	$(xml).find('dict').each(function(){
                   		var position = 1;
                	    $(this).find('array').each(function(){
                	    	var first = true;
                	    	var nombre = "";
                	    	var puntos = "";
                	    	$(this).find('string').each(function(){
                	    		if(first){
                	    			nombre = $(this).text();
                	    			first = false;
                	    		}else{
                	    			puntos = $(this).text();
                	    		}
                	    	});
                            //alert(nombre + " " + puntos);
                	    	$("#sailkapena-list").append(
                	    			'<li class="talde-box">' +
                	    				'<div class="league-pos">' + position + '</div>' +
                	    				'<div class="team-name">' + nombre + '</div>' + 
                	    				'<div class="league-points">' + puntos + '</div>' +
                	    			'</li>'
                	    	);
                	    	position++;
                        });
                    });
                   //window.localStorage.setItem(idEvento, localStorageEvent);
                },
                error: function(){
                   alert("error");
                }
            });
        }
        
        function getInfoAndResults(indice, idRegata){
        	toggleClass("page-sailkapena", 'page', 'page-selected');
        	fillRegataData(indice);
        	getResultadosRegata(idRegata);
        }
        
        function fillRegataData(indice){
        	var regata = getActiveLeagueCalendar()[indice];
        	$("#nombre-regata-field").text(regata.izena);
        	$("#leku-regata-field").text(regata.lekua);
        	$("#data-regata-field").text(regata.data);
        	$("#ordu-regata-field").text(regata.ordua);
        }
        
        var loading = false;
        
        function execLoading(){
        	$("#loading-results").append(".");
        	if(loading){
        		var t = setTimeout(execLoading(),500);
        	}
        }
        
        function getResultadosRegata(idRegata){
        	alert("getting results");
        	$("#loading-results").removeClass("invisible");
        	window.plugins.progressDialog.createProgressDialog(function(){},function(){},[]);
        	alert("ya debería verse");
        	
        	$.ajax({
                type: "GET",
                url: "http://www.ligasanmiguel.com/xml/emaitzakL" + getLeague().toUpperCase() + "2.php?e=" + idRegata ,
                dataType: "xml",
                success: function(xml) {
                	$("#list-regata-results").html("");
                   	//alert("OK -> " + xml);
                   	$(xml).find('dict').each(function(){
                	    $(this).find('array').each(function(){
                	    	$(this).find('array').each(function(){
	                	    	var first = 1;
	                	    	var nombre = "";
	                	    	var position = "";
	                	    	var time = "";
	                	    	var diferencia = "";
	                	    	$(this).find('string').each(function(){
	                	    		if(first == 1){
	                	    			position = $(this).text();
	                	    		}else if(first == 2){
	                	    			nombre = $(this).text();
	                	    		}else if(first == 3){
	                	    			time = $(this).text();
	                	    		}else{
	                	    			//alert("diferencia?:|" + $(this).text() + "|")
	                	    			diferencia = $(this).text();
	                	    			if(diferencia=="")diferencia="&nbsp;";
	                	    		}
	                	    		first++;
	                	    	});
	                            //alert(nombre + " " + puntos);
	                            /*if(nombre.length>20){
	                            	nombre = nombre.substring(0, 18) + "...";
	                            }*/
	                	    	$("#list-regata-results").append(
	                	    		'<li class="talde-box">' +
	                	    			'<div class="league-pos-5">' + position + '</div>' +
	                	    			'<div class="team-name-55">' + nombre + '</div>' + 
	                	    			'<div class="league-time">' + time + '</div>' +
	                	    			'<div class="league-time">' + diferencia + '</div>' +
	                	    		'</li>'
	                	    	);
	                	    	//alert($("#list-regata-results").html());
	                	    	position++;
                	    	});
                        });
                    });
                   	$("#loading-results").addClass("invisible");
                   	loading = false;
                   	window.plugins.progressDialog.quitProgressDialog(function(){},function(){},[]);
                   //window.localStorage.setItem(idEvento, localStorageEvent);
                   //<li class="talde-box"><div class="league-pos">1</div><div class="team-name-55">San Pedro</div><div class="league-time">19:49.48</div><div class="league-time">&nbsp;</div></li>
                   //<li class="talde-box"><div class="league-pos-5">1</div><div class="team-name-55">San Pedro</div><div class="league-time">19:49.48</div><div class="league-time">&nbsp;</div></li>
                },
                error: function(){
                   alert("error");
                   $("#loading-results").addClass("invisible");
                   loading = false;
                }
            });
        	
        }
        
</script>  

  </head>
  <body onload="init();" id="stage" class="theme">
  	<header>
		<h1>ACT 2012</h1>
	</header>

	<div id="league-selection" class="selectable-box">
		<div id="ls-sm" class="league-selection-box" ontouchstart="activeLeague('ls-sm','ls-et');" >
		<!-- onClick="toggleClass('league-selection-sm', 'league-selection-box', 'league-selection-box-selected');"-->
			<img src="img/imgIconoLSM.png" />
			<span>Liga San Miguel</span>
		</div>
		<div id="ls-et" class="league-selection-box"  ontouchstart="activeLeague('ls-et','ls-sm');">
		<!--  onClick="toggleClass('league-selection-et', 'league-selection-box', 'league-selection-box-selected');"-->
			<img src="img/imgLogoLET.png" />
			<span>Liga Eusko Tren</span>
		</div>
	</div>

	<div id="page-gehiago" class="page">
		<ul>
			<li class="singleLineItem" ontouchstart="saveSelectedLanguage();"><label for="lan_es">Castellano</label><input type="radio" name="idioma" id="idioma_es" value="es"></li>
			<li class="singleLineItem" ontouchstart="saveSelectedLanguage();"><label for="lan_ca">Catalá</label><input type="radio" name="idioma" id="idioma_ca" value="ca"/></li>
			<li class="singleLineItem" ontouchstart="saveSelectedLanguage();"><label for="lan_ga">Galego</label><input type="radio" name="idioma" id="idioma_gl" value="gl"/></li>
			<li class="singleLineItem" ontouchstart="saveSelectedLanguage();"><label for="lan_en">English</label><input type="radio" name="idioma" id="idioma_en" value="en"></li>
			<li class="singleLineItem" ontouchstart="saveSelectedLanguage();"><label for="lan_eu">Euskera</label><input type="radio" name="idioma" id="idioma_eu" value="eu"></li>
			<li class="singleLineItem" ontouchstart="saveSelectedLanguage();"><label for="lan_fr">Français</label><input type="radio" name="idioma" id="idioma_fr" value="fr"></li>
		</ul>
	</div>
	
	<div id="page-egutegia" class="page">
		<ul id="list-egutegia" class="page-ul">
			<li id="bandera_1" class="talde-box">
				<a href="#" class="team-link">
					<!-- div class="single-line-text">Bandera de Bilbao casdfnlkasdnla asddklas asdjklasjdas jdaskljda</div>
					<div class="lugar info-adicional">Bilbao</div><div class="fecha-hora info-adicional">(30/06/2012 12:00)</div-->
				</a>
			</li>
		</ul>
	</div>
	
	<div id="page-taldeak" class="page">
		<ul class="page-ul" id="list-taldeak"> 
			<!-- li id="talde_id1" class="talde-box"><a href="#" class="team-link">Nombre equipo</a></li>
			<li id="talde_id2" class="talde-box">Astillero</li-->
		</ul>
	</div>
	
	<div id="page-talde" class="page">
		<!-- p>talde</p-->
		<div id="team-logo" class="image-logo-container">
			<img src="img/taldeak/imgLogoAstillero.gif" />
		</div>
		<div id="team-direction-title" class="data-title-container">Helbidea</div>
		<div id="team-direction" class="data-container">&nbsp;</div>
		<div id="team-telephone-title" class="data-title-container">Tel:</div>
		<div id="team-telephone" class="data-container">&nbsp;</div>
		<div id="team-mail-title" class="data-title-container">Email:</div>
		<div id="team-mail" class="data-container">&nbsp;</div>
		<div id="team-web-title" class="data-title-container">Web:</div>
		<div id="team-web" class="data-container">&nbsp;</div>
		<div class="spacer">&nbsp;</div>
		<div id="enlace-remeros" class="image-logo-container">
			<a href="#" onClick="getRemeros()">
				<img src="img/imgPala.png" />
			</a>
		</div>
	</div>
	
	<div id="page-arraunlariak" class="page">
		<ul id="player-list">
			<li class="talde-box">
				<div style="float:left;">
					<img src="img/arraunlariak_lsm/SinFoto_1.jpg" />
				</div>
				<div class="ul-li-a-text width-70">
					&nbsp;
					<span class="sub-spacer">&nbsp;</span>
					<div class="info-adicional lugar font-normal">&nbsp;</div><div class="info-adicional fecha-hora">&nbsp;</div>
				</div>
			</li>
		</ul>
	</div>
	
	<div id="page-sailkapenak" class="page">
		<ul id="sailkapena-list">
			<!-- li class="talde-box"><div class="league-pos">1</div><div class="team-name">San Pedro</div><div class="league-points">10</div></li>
			<li class="talde-box"><div class="league-pos">2</div><div class="team-name">San Juna</div><div class="league-points">9</div></li-->
		</ul>
	</div>
	
	<div id="page-sailkapena" class="page">
		<div id="regata-info">
			<div id="super-section1">
				<div id="nombre-regata-label" class="font-normal field-name">Ikurriña</div>
				<div id="nombre-regata-field" class="field-value">&nbsp;</div>
			</div>
			<div class="spacer">&nbsp;</div>
			<div id="super-section2">
				<div id="ss21" class="float width-50">
					<div id="leku-regata-label" class="font-normal field-name">Lekua</div>
					<div id="leku-regata-field" class="field-value">&nbsp;</div>
				</div>
				<div id="ss22" class="float width-30">
					<div id="data-regata-label" class="font-normal field-name">Data</div>
					<div id="data-regata-field" class="field-value">&nbsp;</div>
				</div>
				<div id="ss23"class="float width-20">
					<div id="ordu-regata-label" class="font-normal field-name">Ordua</div>
					<div id="ordu-regata-field" class="field-value">&nbsp;</div>
				</div>
			</div>
			<div>&nbsp;</div>
		</div>
		<div id="regata-results-header">
			Emaitzak
		</div>
		<div id="regata-results">
			<div id="loading-results" style="border:1px solid #FFFFFF;">
				<img src="img/loading.gif" class="loading-infinite-loop"></img>
			</div>
			<ul id="list-regata-results">
				<!-- li class="talde-box"><div class="league-pos-5">1</div><div class="team-name-55">San Pedro</div><div class="league-time">19:49.48</div><div class="league-time">&nbsp;</div></li>
				<li class="talde-box"><div class="league-pos-5">2</div><div class="team-name-55">San Juna</div><div class="league-time">19:59.58</div><div class="league-time">00:10.10</div></li>
				<li class="talde-box"><div class="league-pos-5">2</div><div class="team-name-55">123456789012345678901234567890</div><div class="league-time">19:59.58</div><div class="league-time">00:10.10</div></li-->
			</ul>
		</div>
	</div>
	
	<div id="backspacer" style="min-height:70px;" class="visible"></div>
	
	<footer class="visible">
		<div id="footer1" class="footer-section-clickable footer-section-clickable-selected" onClick="openPage(this, 'page-egutegia');" ontouchstart="openPage(this, 'page-egutegia');getCalendario();">
			<div class="footer-icon egutegia_dark" id="egutegia-footer">&nbsp;</div>
			<span id="footer-1-egutegia">Egutegia</span>
		</div>
		<div id="footer2" class="footer-section-clickable" onClick="openPage(this, 'page-taldeak');" ontouchstart="openPage(this, 'page-taldeak');getTeams();">
			<div class="footer-icon taldeak_dark" id="egutegia-footer">&nbsp;</div>
			<span id="footer-2-taldeak">Taldeak</span>
		</div>
		<div id="footer3" class="footer-section-clickable" onClick="openPage(this, 'page-sailkapenak');" ontouchstart="openPage(this, 'page-sailkapenak');getClasificacion();">
			<div class="footer-icon sailkapena_dark" id="egutegia-footer">&nbsp;</div>
			<span id="footer-3-sailkapena">Sailkapena</span>
		</div>
		<div id="footer4" class="footer-section-clickable" onClick="openPage(this, 'page-gehiago');" ontouchstart="openPage(this, 'page-gehiago');">
			<div class="footer-icon gehiago_dark" id="egutegia-footer">&nbsp;</div>
			<span id="footer-4-gehiago">Gehiago</span>
		</div>
	</footer>
  </body>
</html>
